package com.cw.lang.common.framework.inteceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.web.servlet.HandlerInterceptor;

import com.cw.lang.common.framework.utils.CommonResponseUtil;

/**
 * 清理CommonResponse线程上下文参数
 *
 * @author chenw
 * @version $$Id: LocalMvcHandlerInterceptor.java, v 0.1 2018/10/22 6:15 PM chenw Exp $$
 */
@Order(Ordered.HIGHEST_PRECEDENCE + 2000)
public class CommonResponseMvcHandlerInterceptor implements HandlerInterceptor {

    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,
        Exception ex) {
        CommonResponseUtil.removeCommonResponse();
    }
}
